import {
  legacy_createStore as createStore,
  combineReducers,
  applyMiddleware,
} from 'redux';
// 使action可以执行异步函数
import thunk from 'redux-thunk';
// 接入 redux 插件
import { composeWithDevTools } from 'redux-devtools-extension';

// 导入 reducer 干活的
import { login } from './reducers/login';
import { user } from './reducers/user';
import { article } from './reducers/article';

// 创建 store
export const store = createStore(
  combineReducers({ login, user, article }),
  composeWithDevTools(applyMiddleware(thunk))
);
